package com.winter.controller;


import com.winter.model.User;
import com.winter.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by Administrator on 2017/8/16.
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping(value = "/getall",method = RequestMethod.GET)
    public ModelAndView selectAll(){
        User user = userService.selectByPrimaryKey(1);

        ModelAndView modelAndView=new ModelAndView();
        modelAndView.addObject("user",user);
        modelAndView.addObject("test","shanghewen");
        modelAndView.setViewName("test");
        return modelAndView;
    }

}